package stendcontrol;

public class CodeAPI {

    private DataTract dt_tract;
    private StendControlAPI s_control;

    public CodeAPI(DataTract dt_tract, StendControlAPI s_control) {
        this.dt_tract = dt_tract;
        this.s_control = s_control;
    }
    

    
    /**
     * Operation
     *
     * @param n
     * @return int
     */
    public int getSensor(int n) {
        return s_control.getSensor(n);
    }

    /**
     * Operation
     *
     * @param n
     * @return double
     */
    public double getScaleSensor(int n) {
        return s_control.getScaleSensor(n);
    }

    /**
     * Operation
     *
     * @param nmotor
     * @param pos
     * @return
     */
    public void goToPos(int nmotor, long pos) {
        s_control.goToTargetPosition(nmotor, pos);
    }

    /**
     * Operation
     *
     * @param nmotor
     * @param pos
     * @return
     */
    public void goToScalePos(int nmotor, double pos) {
        s_control.goToScaleTargetPosition(nmotor, pos);
    }

    public static final int TYPE_RESEARCH_NONE = 0;
    public static final int TYPE_RESEARCH_DIST = 1;
    public static final int TYPE_RESEARCH_TIME = 2;

    /**
     * Operation
     *  Установить тип исследования (дискретизации) TYPE_RESEARCH_NONE - без
     * передачи данных TYPE_RESEARCH_TIME - дискретизация по времени
     * TYPE_RESEARCH_DIST - дискретизация по расстоянию
     * 
     * @param discType
     * @return
     */
    public void setTypeDiscret(int discType) {
        s_control.setResearchType(discType);
    }

    /**
     * Operation
     *
     * @param speed
     * @return
     */
    public void setSpeedDisc(int speed) {
        s_control.setSpeed(speed);
    }

    /**
     * Operation
     *
     * @param distance
     * @return
     */
    public void setDistanceDisc(int distance) {
        s_control.setSampleInterval(distance);
    }
}
